package com.own.business.log.login.persistence.business.service;

import com.own.business.log.login.persistence.entity.po.LogLogin;
import com.own.business.log.login.persistence.entity.po.LogLoginElasticPo;
import com.own.business.log.login.persistence.entity.query.LogLoginQuery;
import com.own.business.log.login.persistence.entity.vo.LogLoginElasticVo;
import com.own.component.elastic.service.BaseElasticService;

/**
 * LogLoginService
 *
 * @author chenxueli
 * @date 2023-08-07 22:25:01
 */
public interface LogLoginElasticService extends BaseElasticService<
        LogLogin,
        LogLoginElasticPo,
        LogLoginElasticVo,
        LogLoginQuery
        > {

    /**
     * 根据链路id获取日志信息
     *
     * @param traceId 链路id
     * @return 日志信息
     */
    LogLoginElasticVo getByTraceId(String traceId);

    /**
     * 根据用户id查询最新的登录日志信息
     *
     * @param userId 用户id
     * @return 最新的登录日志信息
     */
    LogLoginElasticVo getLastLoginTimeByUserId(Long userId);

    /**
     * 获取最近的一次登录日志信息
     *
     * @param account 账号信息
     * @param type    登录方式
     * @param status  登录的状态信息
     * @return 最新的登录日志信息
     */
    LogLoginElasticVo getLastLoginTimeByAccountAndType(String account, String type, Integer status);

}

